import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      redirect: '/message' // 路由重定向
    },
    {
      path: '/message',
      component: () => import('../components/Message.vue'),
      // 3个子路由
      children: [
        {
          path: 'unpay',
          component: () => import('../components/UnPay.vue')
        },
        {
          path: 'unsend',
          component: () => import('../components/UnSend.vue')
        },
        {
          path: 'unconfirm',
          components: {
            default: () => import('../components/UnConfirm.vue'),
            reGoods: () => import('../components/reGoods.vue')
          }
        }
      ]
    }
  ]
})

export default router